<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:sijyp="http://java.sun.com/jsf/composite/sijyp"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:ui="http://java.sun.com/jsf/facelets">

	<a4j:region id="rg_reclamacion_Table" ajaxRendered="true">
		<rich:dataTable keepSaved="true" id="reclamacionesTable"
			var="record_" rendered="true" style="margin:0 auto;"
			value="#{reclamacionManager.dataModel}" rows="10"
			noDataLabel="${msg['general.registrosNoEncontrados']}">

			<ui:include src="/resources/sijyp/jpaColumn.xhtml">
				<ui:param name="bean" value="#{reclamacionManager}" />
				<ui:param name="propertyTitle"
					value="prueba" />
				<ui:param name="explicitProperty" value="#{record_.bien.idBien}" />
				<ui:param name="propertyFilter" value="bien.idBien" />
				<ui:param name="componentRender" value="reclamacionesTable" />
				<ui:param name="hideColumn" value="true" />
			</ui:include>

			<ui:include src="/resources/sijyp/jpaColumn.xhtml">
				<ui:param name="bean" value="#{reclamacionManager}" />
				<ui:param name="propertyTitle"
					value="bienes.reclamacion.tabla.envioReclamacion" />
				<ui:param name="explicitProperty" value="#{record_.envioReclamacion eq 'TRUE' ? 'SI' : 'NO'}" />
				<ui:param name="propertyFilter" value="envioReclamacion" />
				<ui:param name="componentRender" value="reclamacionesTable" />
			</ui:include>

			<ui:include src="/resources/sijyp/jpaColumn.xhtml">
				<ui:param name="bean" value="#{reclamacionManager}" />
				<ui:param name="propertyTitle"
					value="bienes.reclamacion.tabla.fechaRemision" />
				<ui:param name="explicitProperty" value="#{record_.fechaRemision}" />
				<ui:param name="propertyFilter" value="fechaRemision" />
				<ui:param name="componentRender" value="reclamacionesTable" />
				<ui:param name="fecha" value="true" />
			</ui:include>

			<ui:include src="/resources/sijyp/jpaColumn.xhtml">
				<ui:param name="bean" value="#{monetizacionManager}" />
				<ui:param name="propertyTitle"
					value="bienes.reclamacion.tabla.persona" />
				<ui:param name="explicitProperty" value="#{record_.persona.nombre}" />
				<ui:param name="propertyFilter" value="idPersona" />
				<ui:param name="componentRender" value="reclamacionesTable" />
				<ui:param name="fecha" value="true" />
			</ui:include>

			<rich:column>
				<f:facet name="header">
					<h:commandLink
						value="${msg['bienes.origen.versionLibre.tabla.acciones']}">
						<f:ajax execute="@none" />
					</h:commandLink>
				</f:facet>
				<h:panelGrid columns="3"
					columnClasses="icon_space,icon_space,icon_space,icon_space,icon_space">

					<h:commandLink action="#{reclamacionManager.prepareUpdate}"
						rendered="#{!disableReclamacionFields and !bienManager.reading and !bienManager.disableSubtabsEditAction}">
						<h:graphicImage value="/resources/images/icons/ico_pencil.png"
							title="${msg['boton.editar']}" />
						<f:setPropertyActionListener
							target="#{reclamacionManager.bienReclamacion}"
							value="#{record_}" />
						<f:setPropertyActionListener target="#{reclamacionManager.crud}"
							value="update" />
						<f:ajax execute="@this"
							render=":formTabs:formReclamacion :sijypMessages" />
					</h:commandLink>

					<ui:remove>Gray edit action icon</ui:remove>
					<h:graphicImage value="/resources/images/icons/ico_pencil_gray.png"
						title="${msg['boton.editar']}"
						rendered="#{bienManager.disableSubtabsEditAction}" />

					<h:commandLink action="#{reclamacionManager.prepareRead}">
						<h:graphicImage value="/resources/images/icons/ico_details.png"
							title="${msg['boton.consultar']}" />
						<f:setPropertyActionListener
							target="#{reclamacionManager.bienReclamacion}"
							value="#{record_}" />
						<f:setPropertyActionListener target="#{reclamacionManager.crud}"
							value="read" />
						<f:ajax execute="@this"
							render=":formTabs:formReclamacion :sijypMessages" />
					</h:commandLink>

					<a4j:commandLink value="" execute="@this" render="@none"
						title="${msg['boton.eliminar']}"
						rendered="#{!reclamacionManager.reading and !bienManager.reading and !bienManager.disableSubtabsDeleteAction}"
						oncomplete="#{rich:component('confirmDeleteReclamacion')}.show()">
						<h:graphicImage value="/resources/images/icons/ico_delete.png"
							title="${msg['boton.eliminar']}" />
						<a4j:param value="#{record_.id}"
							assignTo="#{reclamacionManager.idReclamacionDelete}" />
					</a4j:commandLink>

					<ui:remove>Gray delete action icon</ui:remove>
					<h:graphicImage
						value="/resources/images/icons/ico_delete_disabled.png"
						title="${msg['boton.eliminar']}"
						rendered="#{bienManager.disableSubtabsDeleteAction}" />
				</h:panelGrid>
			</rich:column>
			<f:facet name="footer">
				<rich:dataScroller maxPages="10" fastStep="5" fastControls="hide" stepControls="show" />
			</f:facet>
		</rich:dataTable>

		<sijyp:confirmDialog message="${msg['general.confirmaBorrar']}"
			confirmId="confirmDeleteReclamacion"
			renderComponents="confirmDeleteReclamacion :sijypMessages :formTabs:formReclamacion"
			acceptAction="#{reclamacionManager.deleteReclamacion}" />

	</a4j:region>
</ui:composition>